package com.qst.mapreduce.wordcount.kaoshi.kaoshi3;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class WebLog implements Writable {
    private String visitTime;
    private String visitIp;
    private String visitAddress;

    @Override
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(visitTime);
        dataOutput.writeUTF(visitIp);
        dataOutput.writeUTF(visitAddress);

    }

    @Override
    public void readFields(DataInput dataInput) throws IOException {
        visitTime = dataInput.readUTF();
        visitIp = dataInput.readUTF();
        visitAddress = dataInput.readUTF();
    }

    public String toString(){
        return visitTime + "\t" + visitIp + "\t" + visitAddress;
    }


    public String getVisitAddress() {
        return visitAddress;
    }

    public void setVisitAddress(String visitAddress) {
        this.visitAddress = visitAddress;
    }

    public String getVisitIp() {
        return visitIp;
    }

    public void setVisitIp(String visitIp) {
        this.visitIp = visitIp;
    }

    public String getVisitTime() {
        return visitTime;
    }

    public void setVisitTime(String visitTime) {
        this.visitTime = visitTime;
    }
}
